#include "ConfigFile.h"

ConfigFile::ConfigFile(const QString filename)
	:m_settings(filename,QSettings::IniFormat)
{
}

bool ConfigFile::isOpen() const
{
	return m_settings.status() == QSettings::NoError;
}

void ConfigFile::setValue(QAnyStringView key, const QVariant& value)
{
	m_settings.setValue(key, value);
}

QVariant ConfigFile::value(QAnyStringView key) const
{
	return m_settings.value(key,QVariant());
}

QVariant ConfigFile::value(QAnyStringView key, const QVariant& def_value)const
{
	return m_settings.value(key, def_value);
}

void ConfigFile::removeValue(QAnyStringView key)
{
	m_settings.remove(key);
}